/**
 * 
 */
package server;

import java.net.InetAddress;

/**
 * @author Sefverl
 *
 */
public class ClientObject {

	private String clientName;
	private int clientID;
	private InetAddress address;
	private ClientHandler handler;
	private double version = 1.0;
	
	public ClientObject()
	{
		
	}
	public ClientObject(String name,int id,InetAddress addr)
	{
		clientName = name;
		clientID = id;
		address = addr;
	}
	
	public String getClientName() {
		return clientName;
	}

	public void setClientName(String clientName) {
		this.clientName = clientName;
	}

	public int getClientID() {
		return clientID;
	}

	public void setClientID(int clientID) {
		this.clientID = clientID;
	}

	public InetAddress getAddress() {
		return address;
	}

	public void setAddress(InetAddress address) {
		this.address = address;
	}
	
	/**
	 * Compare objects for equality
	 */
	public boolean equals(Object o)
	{
		if(o == this) return true;
		
		if(o instanceof ClientObject)
		{
			ClientObject co = (ClientObject) o;
			
			if(getClientName().equals(co.getClientName()) && 
					getAddress().equals(co.getAddress()) && 
					getClientID() == co.getClientID()) 
				return true;
		}
		
		return false;
	}

	/**
	 * @param version the version to set
	 */
	public void setVersion(double version) {
		this.version = version;
	}

	/**
	 * @return the version
	 */
	public double getVersion() {
		return version;
	}
	/**
	 * @param handler the handler to set
	 */
	public void setHandler(ClientHandler handler) {
		this.handler = handler;
	}
	/**
	 * @return the handler
	 */
	public ClientHandler getHandler() {
		return handler;
	}

	
}
